package cn.itcast.classSM.domain;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "T_MAIN_CHECK_MESSAGE")
// 查班主信息
public class MainCheckMessage {

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "MCM_MMID")
	private Integer mmid; // 主键id
	@Column(name = "MCM_SHOULD_ARRIVE")
	private Integer shouldArrive; // 应到人数
	@Column(name = "MCM_FACT_ARRIVE")
	private Integer factArrive; // 实到人数
	@Column(name = "MCM_LATENAME")
	private String lateName; // 迟到人名字
	@Column(name = "MCM_LEAVENAME")
	private String leaveName; // 请假人名字
	@Column(name = "MCM_WERSLIPPERS")
	private Integer wearSlippers; // 穿拖鞋人数
	@Column(name = "MCM_SLEEPING")
	private Integer sleeping; // 睡觉人数
	@Column(name = "MCM_PHONENUMBER")
	private Integer phoneNumber; // 未交手机数
	@Column(name = "MCM_HYGIENE")
	private Integer hygiene; // 卫生 0.好 1.不好
	@Column(name = "MCM_ATMOSPHERE")
	private Integer atmosphere; // 学习氛围 0.好 1.不好
	@Column(name = "MCM_REMARK")
	private String remark; // 备注
	@Column(name = "MCM_ATTENDANCE")
	private Double attendance; // 出勤率

	@ManyToOne
	@JoinColumn(name = "MCM_CLAZZ_ID")
	private Clazz mcmClazz; // 班级id

	@ManyToMany
	@JoinTable(name = "Z_MCM_TIMEDUL", joinColumns = {
			@JoinColumn(name = "Z_MCM_ID", referencedColumnName = "MCM_MMID") }, inverseJoinColumns = {
					@JoinColumn(name = "Z_TIMEDUL_ID", referencedColumnName = "CT_TDID") })
	private Set<CheckTimeDul> checkTimeDuls = new HashSet<CheckTimeDul>(); // 时间段id

	@ManyToOne
	@JoinColumn(name = "MCM_CHECKMESSAGE_ID")
	private CheckMessage mcmCheckMessage; // 基本查班信息id

	public Set<CheckTimeDul> getCheckTimeDuls() {
		return checkTimeDuls;
	}

	public void setCheckTimeDuls(Set<CheckTimeDul> checkTimeDuls) {
		this.checkTimeDuls = checkTimeDuls;
	}

	public Integer getMmid() {
		return mmid;
	}

	public void setMmid(Integer mmid) {
		this.mmid = mmid;
	}

	public Integer getShouldArrive() {
		return shouldArrive;
	}

	public void setShouldArrive(Integer shouldArrive) {
		this.shouldArrive = shouldArrive;
	}

	public Integer getFactArrive() {
		return factArrive;
	}

	public void setFactArrive(Integer factArrive) {
		this.factArrive = factArrive;
	}

	public String getLateName() {
		return lateName;
	}

	public void setLateName(String lateName) {
		this.lateName = lateName;
	}

	public String getLeaveName() {
		return leaveName;
	}

	public void setLeaveName(String leaveName) {
		this.leaveName = leaveName;
	}

	public Integer getWearSlippers() {
		return wearSlippers;
	}

	public void setWearSlippers(Integer wearSlippers) {
		this.wearSlippers = wearSlippers;
	}

	public Integer getSleeping() {
		return sleeping;
	}

	public void setSleeping(Integer sleeping) {
		this.sleeping = sleeping;
	}

	public Integer getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(Integer phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public Integer getHygiene() {
		return hygiene;
	}

	public void setHygiene(Integer hygiene) {
		this.hygiene = hygiene;
	}

	public Integer getAtmosphere() {
		return atmosphere;
	}

	public void setAtmosphere(Integer atmosphere) {
		this.atmosphere = atmosphere;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Double getAttendance() {
		return attendance;
	}

	public void setAttendance(Double attendance) {
		this.attendance = attendance;
	}

	public Clazz getMcmClazz() {
		return mcmClazz;
	}

	public void setMcmClazz(Clazz mcmClazz) {
		this.mcmClazz = mcmClazz;
	}

	public CheckMessage getMcmCheckMessage() {
		return mcmCheckMessage;
	}

	public void setMcmCheckMessage(CheckMessage mcmCheckMessage) {
		this.mcmCheckMessage = mcmCheckMessage;
	}

	@Override
	public String toString() {
		return "MainCheckMessage [mmid=" + mmid + ", shouldArrive=" + shouldArrive + ", factArrive=" + factArrive
				+ ", lateName=" + lateName + ", leaveName=" + leaveName + ", wearSlippers=" + wearSlippers
				+ ", sleeping=" + sleeping + ", phoneNumber=" + phoneNumber + ", hygiene=" + hygiene + ", atmosphere="
				+ atmosphere + ", remark=" + remark + ", attendance=" + attendance + ", mcmClazz=" + mcmClazz
				+ ", checkTimeDuls=" + checkTimeDuls + ", mcmCheckMessage=" + mcmCheckMessage + "]";
	}
	
}
